package com.aspose.cells;

public class Line {
   protected Object a;
   private Workbook d;
   private zji e;
   zakp b;
   int c;
   private int f = 0;
   private GradientFill g;

   Line(Chart chart, Object parent) {
      this.a = parent;
      if (chart != null) {
         this.d = chart.j().n();
      }

      this.b = new zakp(true);
   }

   Line(Workbook workbook, Object parent) {
      this.a = parent;
      this.d = workbook;
      this.b = new zakp(true);
   }

   zji f() {
      return this.e;
   }

   zji g() {
      if (this.e == null) {
         this.e = new zji();
      }

      return this.e;
   }

   public int getCompoundType() {
      if (this.e != null) {
         Object var1 = this.e.a(0);
         if (var1 != null) {
            return (Integer)var1;
         }
      }

      return 0;
   }

   public void setCompoundType(int value) {
      this.b(value);
      this.a(value);
   }

   void b(int var1) {
      this.g().a(0, var1);
      this.i();
   }

   private void a(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().b(var1);
         }
      }

   }

   public int getDashType() {
      Object var1 = this.g().a(1);
      return var1 != null ? (Integer)var1 : 6;
   }

   public void setDashType(int value) {
      this.c(value);
      this.o(value);
   }

   void c(int var1) {
      this.g().a(1, var1);
      this.i();
   }

   private void o(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().c(var1);
         }
      }

   }

   private Series a() {
      if (!(this.a instanceof zor)) {
         return null;
      } else {
         zor var1 = (zor)this.a;
         if (!(var1.t() instanceof Series)) {
            return null;
         } else {
            Series var2 = (Series)var1.t();
            return var2;
         }
      }
   }

   public int getCapType() {
      Object var1 = this.g().a(2);
      return var1 != null ? (Integer)var1 : this.b();
   }

   public void setCapType(int value) {
      this.d(value);
      this.p(value);
   }

   private int b() {
      Series var1 = null;
      if (this.a instanceof zor) {
         zor var2 = (zor)this.a;
         if (var2.t() instanceof Series) {
            var1 = (Series)var2.t();
         } else if (var2.t() instanceof ChartPoint) {
            var1 = ((ChartPoint)var2.t()).a();
         }
      }

      if (var1 != null) {
         switch(var1.getType()) {
         case 37:
         case 38:
         case 39:
         case 40:
         case 41:
         case 42:
         case 43:
         case 57:
         case 58:
         case 61:
         case 62:
         case 63:
         case 64:
            return 1;
         case 44:
         case 45:
         case 46:
         case 47:
         case 48:
         case 49:
         case 50:
         case 51:
         case 52:
         case 53:
         case 54:
         case 55:
         case 56:
         case 59:
         case 60:
         default:
            return 2;
         }
      } else {
         return 2;
      }
   }

   void d(int var1) {
      this.g().a(2, var1);
      this.i();
   }

   private void p(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().d(var1);
         }
      }

   }

   public int getJoinType() {
      Object var1 = this.g().a(3);
      return var1 != null ? (Integer)var1 : 0;
   }

   public void setJoinType(int value) {
      this.e(value);
      this.q(value);
   }

   void e(int var1) {
      this.g().a(3, var1);
      this.i();
   }

   private void q(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().e(var1);
         }
      }

   }

   public int getBeginType() {
      Object var1 = this.g().a(4);
      return var1 != null ? (Integer)var1 : 0;
   }

   public void setBeginType(int value) {
      this.f(value);
      this.r(value);
   }

   void f(int var1) {
      this.g().a(4, var1);
   }

   private void r(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().f(var1);
         }
      }

   }

   public int getEndType() {
      Object var1 = this.g().a(7);
      return var1 != null ? (Integer)var1 : 0;
   }

   public void setEndType(int value) {
      this.g(value);
      this.s(value);
   }

   void g(int var1) {
      this.g().a(7, var1);
   }

   private void s(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().g(var1);
         }
      }

   }

   public int getBeginArrowLength() {
      Object var1 = this.g().a(6);
      return var1 != null ? (Integer)var1 : 1;
   }

   public void setBeginArrowLength(int value) {
      this.h(value);
      this.t(value);
   }

   void h(int var1) {
      this.g().a(6, var1);
   }

   private void t(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().h(var1);
         }
      }

   }

   public int getEndArrowLength() {
      Object var1 = this.g().a(9);
      return var1 != null ? (Integer)var1 : 1;
   }

   public void setEndArrowLength(int value) {
      this.i(value);
      this.u(value);
   }

   void i(int var1) {
      this.g().a(9, var1);
   }

   private void u(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().i(var1);
         }
      }

   }

   public int getBeginArrowWidth() {
      Object var1 = this.g().a(5);
      return var1 != null ? (Integer)var1 : 1;
   }

   public void setBeginArrowWidth(int value) {
      this.j(value);
      this.v(value);
   }

   void j(int var1) {
      this.g().a(5, var1);
   }

   private void v(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().j(var1);
         }
      }

   }

   public int getEndArrowWidth() {
      Object var1 = this.g().a(8);
      return var1 != null ? (Integer)var1 : 1;
   }

   public void setEndArrowWidth(int value) {
      this.k(value);
      this.w(value);
   }

   void k(int var1) {
      this.g().a(8, var1);
   }

   private void w(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().k(var1);
         }
      }

   }

   void a(Color var1) {
      if (var1.isEmpty()) {
         this.b.a(0, 0);
      } else {
         this.b.a(2, var1.toArgb());
      }

      this.i();
      this.f |= 1024;
   }

   public Color getColor() {
      return this.b.b(this.d);
   }

   public void setColor(Color value) {
      this.b(value);
      this.c(value);
   }

   void b(Color var1) {
      if (var1.isEmpty()) {
         this.b.a(0, 0);
      } else {
         this.b.a(2, var1.toArgb());
         if (this.getFormattingType() == 2 || this.getFormattingType() == 0) {
            this.n(1);
         }
      }

      this.i();
      this.f |= 1024;
   }

   private void c(Color var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().b(var1);
         }
      }

   }

   int h() {
      return zakp.e(this.b);
   }

   void l(int var1) {
      this.b = zakp.a(this.b, var1);
   }

   public double getTransparency() {
      return com.aspose.cells.b.a.zq.b((double)(100 - this.h()) / 100.0D, 2);
   }

   public void setTransparency(double value) {
      this.b(value);
      this.a(value);
   }

   void b(double var1) {
      if (var1 >= 0.0D && var1 <= 1.0D) {
         this.l(100 - (int)(var1 * 100.0D));
      } else {
         throw new CellsException(6, "Transparency must between 0.0 (opaque) and 1.0 (clear)");
      }
   }

   private void a(double var1) {
      Series var3 = this.a();
      if (var3 != null && var3.b() != null) {
         ChartPointCollection var4 = var3.b();
         int var5 = var4.getCount();

         for(int var6 = 0; var6 < var5; ++var6) {
            ChartPoint var7 = var4.get(var6);
            var7.getBorder().b(var1);
         }
      }

   }

   void i() {
      if (this.a != null) {
         if (this.a instanceof ChartFrame) {
            ((ChartFrame)this.a).a((Object)null);
         } else if (this.a instanceof DateTime) {
            ((zor)this.a).a((Object)null);
         }
      }

      if (this.getFormattingType() == 0) {
         this.n(1);
      }

   }

   public int getStyle() {
      if (this.f() != null && this.getDashType() != 6) {
         switch(this.getDashType()) {
         case 0:
         case 3:
         case 4:
            return 1;
         case 1:
            return 3;
         case 2:
            return 4;
         case 5:
         case 7:
            return 2;
         case 6:
         }
      }

      switch((this.f & 240) >> 4) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
      default:
         return 0;
      case 6:
         return 6;
      case 7:
         return 7;
      case 8:
         return 8;
      }
   }

   public void setStyle(int value) {
      this.m(value);
      this.x(value);
   }

   void m(int var1) {
      this.f &= -241;
      if (this.f() != null && this.getDashType() != 6) {
         this.c(6);
      }

      this.setVisible(true);
      switch(var1) {
      case 1:
         this.f |= 16;
         this.c(0);
         break;
      case 2:
         this.f |= 32;
         this.c(7);
         break;
      case 3:
         this.f |= 48;
         this.c(1);
         break;
      case 4:
         this.f |= 64;
         this.c(2);
      case 5:
      default:
         break;
      case 6:
         this.f |= 96;
         break;
      case 7:
         this.f |= 112;
         break;
      case 8:
         this.f |= 128;
      }

      this.i();
      this.f |= 2048;
   }

   private void x(int var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().m(var1);
         }
      }

   }

   public int getWeight() {
      if (this.c <= 3175) {
         return -1;
      } else if (this.c <= 12700) {
         return 0;
      } else {
         return this.c <= 25400 ? 1 : 2;
      }
   }

   public void setWeight(int value) {
      switch(value) {
      case -1:
         this.c = 3175;
         break;
      case 0:
         this.c = 12700;
         break;
      case 1:
         this.c = 25400;
         break;
      case 2:
         this.c = 38100;
      }

      this.i();
      this.f |= 512;
   }

   public double getWeightPt() {
      return (double)this.c / zml.i;
   }

   public void setWeightPt(double value) {
      this.c(value);
      this.d(value);
   }

   void c(double var1) {
      this.c = (int)(var1 * zml.i + 0.5D);
      this.i();
      this.f |= 512;
   }

   private void d(double var1) {
      Series var3 = this.a();
      if (var3 != null && var3.b() != null) {
         ChartPointCollection var4 = var3.b();
         int var5 = var4.getCount();

         for(int var6 = 0; var6 < var5; ++var6) {
            ChartPoint var7 = var4.get(var6);
            var7.getBorder().c(var1);
         }
      }

   }

   public double getWeightPx() {
      int var1 = 96;
      if (this.d != null) {
         var1 = this.d.getWorksheets().L();
      }

      return (double)((int)(this.getWeightPt() * (double)var1 / 72.0D + 0.5D));
   }

   public void setWeightPx(double value) {
      int var3 = 96;
      if (this.d != null) {
         var3 = this.d.getWorksheets().L();
      }

      this.setWeightPt(value * 72.0D / (double)var3);
   }

   public int getFormattingType() {
      switch(this.f & 15) {
      case 0:
         return 0;
      case 1:
         return 2;
      case 2:
         return 1;
      case 3:
         return 3;
      default:
         return 0;
      }
   }

   public void setFormattingType(int value) {
      this.n(value);
   }

   void n(int var1) {
      this.f &= -16;
      switch(var1) {
      case 0:
      default:
         break;
      case 1:
         this.f |= 2;
         break;
      case 2:
         this.f |= 1;
         break;
      case 3:
         this.f |= 3;
      }

      this.f |= 256;
   }

   boolean j() {
      return (this.f & 512) != 0;
   }

   void a(boolean var1) {
      if (var1) {
         this.f |= 1024;
      } else {
         this.f &= -1025;
      }

   }

   public boolean isAutomaticColor() {
      return (this.f & 1024) == 0;
   }

   public boolean isVisible() {
      return this.getFormattingType() != 2;
   }

   public void setVisible(boolean value) {
      this.n(value ? 0 : 2);
      this.i();
   }

   public boolean isAuto() {
      return this.getFormattingType() == 0;
   }

   public void setAuto(boolean value) {
      this.b(value);
      this.c(value);
   }

   void b(boolean var1) {
      this.n(var1 ? 0 : 1);
   }

   private void c(boolean var1) {
      Series var2 = this.a();
      if (var2 != null && var2.b() != null) {
         ChartPointCollection var3 = var2.b();
         int var4 = var3.getCount();

         for(int var5 = 0; var5 < var4; ++var5) {
            ChartPoint var6 = var3.get(var5);
            var6.getBorder().b(var1);
         }
      }

   }

   public GradientFill getGradientFill() {
      if (this.getFormattingType() == 3) {
         if (this.g == null) {
            this.g = new GradientFill(this, this.d);
         }

         return this.g;
      } else {
         return null;
      }
   }

   void a(Line var1) {
      if (var1.b.b() == 2 && var1.d != this.d) {
         this.b.a(2, var1.b.c(var1.d));
      } else {
         this.b.f(var1.b);
      }

      if (var1.e != null) {
         this.e = new zji();
         this.e.a(var1.e);
      }

      if (var1.g != null) {
         this.g = new GradientFill(this, this.d);
         this.g.a(var1.g);
      }

      this.c = var1.c;
      this.f = var1.f;
   }

   boolean b(Line var1) {
      if (!this.b.g(var1.b)) {
         return false;
      } else {
         if (this.e != null || var1.e != null) {
            if (this.e == null) {
               this.e = new zji();
            }

            if (this.e == null || var1.e == null) {
               return false;
            }

            if (!this.e.b(var1.e)) {
               return false;
            }
         }

         if (this.g != null || var1.g != null) {
            if (this.g == null || var1.g == null) {
               return false;
            }

            if (!this.g.b(var1.g)) {
               return false;
            }
         }

         if (this.c != var1.c) {
            return false;
         } else if (this.f != var1.f) {
            return false;
         } else {
            return true;
         }
      }
   }
}
